package api;

import java.io.Serializable;
import java.util.List;

import system.MapperResult;
import system.ReducerResult;

/**
 * The interface which defines the basic components of MapReduce task
 * @author Mayuri Karra, Bing Wei
 *
 */

public interface Task extends Serializable{
	/**
	 * Method for map component. It takes a <key, value> pair
	 * and returns a list of <key, value> pairs
	 * @param key that is to mapped
	 * @param value 
	 * @return a list of MapperResults which is essentially <key,value> pairs 
	 */
	List<MapperResult> map(Object key, Object value);
	

	/**
	 * Method for the reduce component. It takes a list of <key, list<value>> pairs
	 * and returns ReducerResult
	 * @param key
	 * @param values
	 * @return ReducerResult which has <key, value>
	 */
	public ReducerResult reduce(Object key, List<Object> values);
	
}
